from tkinter import *

print('Введите начальную координату X:')
x = int(input())
print('Введите начальную координату Y:')
y = int(input())
print('Введите коэффициент увеличения N:')
n = int(input())

coords = [0,0,10,0,10,10,20,10,20,20,0,20]

if n == 0 and x>=0 and x<=500 and y>=0 and y<=500:
    pass
else:
    if n > 0 and 0*n+x>=0 and 0*n+y>=0 and 20*n+x<=500 and 20*n+y<=500:
        pass
    else:
        if n < 0 and 20*n+x>=0 and 20*n+y>=0 and 0*n+x<=500 and 0*n+y<=500:
            pass
        else:
            print('Размер фигуры превышает максимальный размер поля')
            exit()

root = Tk()
root.title("ИТ марафон")
root.geometry("500x500")

canvas = Canvas(bg="white", width=500, height=500)
canvas.pack(anchor=CENTER, expand=1)

canvas.create_polygon(10*n+x,10*n+y,20*n+x,10*n+y,20*n+x,20*n+y,30*n+x,20*n+y,30*n+x,30*n+y,20*n+x,30*n+y,20*n+x,40*n+y,10*n+x,40*n+y,10*n+x,10*n+y)
canvas.create_polygon(50*n+x,10*n+y,60*n+x,10*n+y,60*n+x,20*n+y,70*n+x,20*n+y,70*n+x,10*n+y,80*n+x,10*n+y,80*n+x,30*n+y,50*n+x,30*n+y,50*n+x,10*n+y)
canvas.create_polygon(100*n+x,10*n+y,110*n+x,10*n+y,110*n+x,20*n+y,120*n+x,20*n+y,120*n+x,40*n+y,110*n+x,40*n+y,110*n+x,30*n+y,100*n+x,30*n+y,100*n+x,10*n+y)
root.mainloop()
